package com.qf.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author 10202
 * @version V1.0
 * @Project xiaomi
 * @Package com.qf.utils
 * @Date 2023/4/13 14:59
 */
public class CodeUtils {
    public static String createCode(){
        Date date=new Date();
        SimpleDateFormat  sdf=new SimpleDateFormat("yyyyMMddHHmmss");
        String s1 = sdf.format(date);
        int i = new Random().nextInt(100000);
        String s2 = Integer.toString(i);
        return s1+s2;
    }
    public static String createOrderId(){
        Date date=new Date();
        SimpleDateFormat  sdf=new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String s1 = sdf.format(date);
        int i = new Random().nextInt(10000);
        String s2 = Integer.toString(i);
        return s1+s2;
    }
}
